package rpc.frame.order;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import rpc.frame.OrderService;
import rpc.frame.core.annotation.RpcRemote;

import javax.annotation.Resource;

@RestController
@RequestMapping("/order")
public class OrderController {


    /**
     * 1.为 orderService 动态代理 （在需要动态代理的类上添加 RpcRemote 注解）
     * 2.在代理中调用服务端(网络通讯)
     * 3.解析服务端返回的参数
     */


    @RpcRemote
    public OrderService orderService;

    @GetMapping("/getOrder")
    public String getOrder(String orderId,String userName){
        return orderService.getOrder(orderId,userName);
    }

}
